public class Cbl_ProductUpPriceApprove {
	
	public static void ProductUpPrice(List<ProductUpPrice__c> list_new)
	{
		set<Id> set_Owner=new set<Id>();
		for(ProductUpPrice__c pp:list_new)
		{
			set_Owner.add(pp.OwnerId);
		}
		List<User> list_u=[select id,SubCompany__c,ManagerId,SalesManageDeptTeam__c,CenterExecutiveManager__c,SubCompanyManager__c
		from User where id in:set_Owner];
		Map<Id,User> map_user=new Map<Id,User>();
		for(User u:list_u)
		{
			map_user.put(u.Id,u);
		}
		
		for(ProductUpPrice__c pup:list_new)
		{
			if(map_user.containsKey(pup.OwnerId))
			{
				User Uo=map_user.get(pup.OwnerId);
				if(Uo.SubCompany__c=='四川省迈克实业有限公司'||Uo.SubCompany__c=='云南迈克科技有限公司'||Uo.SubCompany__c=='贵州迈克科技有限公司'||Uo.SubCompany__c=='重庆征途科技有限公司')
				{
					pup.Is_Swr__c=true;
				}
				pup.SalesManager__c=Uo.SalesManageDeptTeam__c;
				pup.CenterExecutiveManager__c=Uo.CenterExecutiveManager__c;
				pup.SubCompanyManager__c=Uo.SubCompanyManager__c;
				
			}
			
		}
	}

}